Popular Searches
Popular Course Categories
Popular Courses

Applying Approximate and Exact Match Lookups

Applying Approximate and Exact Match Lookups

Advanced Lookup and Reference Functions

Applying Approximate and Exact Match Lookups in Excel

Course: Advanced Excel

Topic: Applying Approximate and Exact Match Lookups

Course Link: Advanced Excel Course – JustAcademy

Demo Registration: Register for a Free Course Demo

Training Provider: JustAcademy


1. Introduction to Exact and Approximate Match Lookups

Lookup functions in Microsoft Excel help users search for a specific value in a dataset and return related information from another cell, row, or column. Exact match and approximate match lookups are two important lookup methods used for retrieving data accurately and efficiently.

An exact match lookup searches for a value that matches the lookup value exactly. It is useful when searching for employee IDs, product codes, invoice numbers, customer names, or transaction references.

An approximate match lookup searches for an exact value when available or selects the closest qualifying value according to the lookup function's matching rules. It is especially useful for calculating commission rates, assigning grades, determining tax brackets, applying discounts, and finding shipping charges based on ranges.

Understanding the difference between these methods helps prevent incorrect calculations and improves the reliability of Excel reports and business models.

2. Learning Objectives

  • Understand the difference between exact and approximate matching.
  • Learn how to apply exact matching with XLOOKUP, VLOOKUP, and MATCH.
  • Use approximate matching to retrieve values from grading and commission tables.
  • Understand the importance of sorting data for approximate lookups.
  • Use IFERROR and not-found arguments to handle missing values.
  • Choose the correct lookup method for different business scenarios.
  • Troubleshoot common lookup errors and validate results.

3. What Is an Exact Match Lookup?

An exact match lookup returns a result only when the lookup value matches an entry in the lookup range according to the function's matching rules. If the value is not found, the formula can return an error or a custom message, depending on the function used.

Example Dataset

Employee ID Employee Name Department
E101 Rahul Sales
E102 Priya Finance
E103 Amit IT
E104 Neha Marketing

Suppose cell E2 contains employee ID E103. The objective is to find the corresponding employee name.

Using XLOOKUP for an Exact Match

=XLOOKUP(E2,A2:A5,B2:B5,"Employee Not Found",0)

Explanation:

  • E2 contains the employee ID to search for.
  • A2:A5 is the lookup range containing employee IDs.
  • B2:B5 is the return range containing employee names.
  • "Employee Not Found" is the message returned if no match exists.
  • 0 explicitly requests an exact match.

Expected result: Amit.

XLOOKUP uses exact matching by default, but specifying match mode 0 makes the intended behavior clear to anyone reviewing the formula.

Using VLOOKUP for an Exact Match

=VLOOKUP(E2,A2:C5,2,FALSE)

Explanation:

  • E2 is the lookup value.
  • A2:C5 is the complete table range.
  • 2 specifies the second column of the selected table as the return column.
  • FALSE requests an exact match.

Important: VLOOKUP searches for the lookup value in the first column of the selected table and returns a value from a column to its right. XLOOKUP can return values from either side of the lookup range.

4. What Is an Approximate Match Lookup?

An approximate match lookup is used when the desired result depends on a range, threshold, or nearest qualifying value rather than only an identical entry. For example, a sales employee may receive a commission rate based on the sales amount achieved.

Approximate matching can work differently across Excel functions. With VLOOKUP using TRUE or an omitted final argument, Excel searches for an exact match or the largest value less than or equal to the lookup value. With XLOOKUP, the match mode determines whether Excel chooses the next smaller or next larger item when an exact match is unavailable.

Example: Commission Rate Table

Minimum Sales Commission Rate
0 2%
10000 4%
25000 6%
50000 8%
100000 10%

Assume the minimum sales values are in A2:A6 and the commission rates are in B2:B6. If an employee achieves sales of 32,000, the applicable rate is 6%, because 25,000 is the largest threshold that does not exceed 32,000.

Using VLOOKUP for Approximate Matching

=VLOOKUP(E2,A2:B6,2,TRUE)

If E2 contains 32000, the formula returns 6%, provided the minimum-sales column is sorted in ascending order.

Why TRUE? The fourth argument of VLOOKUP is the range_lookup argument. TRUE requests an approximate match. FALSE requests an exact match.

Important requirement: For reliable VLOOKUP approximate matching, the first column of the table must be sorted in ascending order. Unsorted thresholds can produce incorrect results.

Using XLOOKUP for Approximate Matching

=XLOOKUP(E2,A2:A6,B2:B6,"No Rate",-1)

In XLOOKUP, match mode -1 means exact match or the next smaller item. With sales of 32,000, Excel finds the threshold of 25,000 and returns 6%.

Unlike VLOOKUP's approximate-match method, XLOOKUP's match mode explicitly describes how to handle a missing exact value. The lookup data should still be organized carefully so that the selected threshold has the intended business meaning.

5. Exact Match vs. Approximate Match

Feature Exact Match Approximate Match
Purpose Find an identical lookup value Find a value based on a threshold or nearest qualifying entry
Common examples Employee ID, SKU, invoice number Commission rate, grades, discounts, tax brackets
VLOOKUP setting FALSE or 0 TRUE or 1
XLOOKUP setting Match mode 0 Match mode -1 or 1, depending on the requirement
Sorting requirement Not required for ordinary exact-match searches Required for reliable VLOOKUP approximate matching; XLOOKUP data should follow the intended threshold order
If no exact entry exists Returns a not-found result or error May return the next smaller or larger qualifying entry
Typical use Retrieving a customer's contact details Assigning a discount based on purchase value

6. Understanding VLOOKUP Match Settings

The fourth argument of VLOOKUP determines how Excel searches for a match.

Argument Behavior Recommended Use
FALSE or 0 Requires an exact match IDs, product codes, names and transaction references
TRUE or 1 Finds an exact match or the largest value less than or equal to the lookup value Sorted threshold tables, grading scales and commission slabs
Omitted Defaults to approximate matching Avoid omitting this argument when the intended match behavior should be explicit

Best practice: Always specify FALSE for exact-match VLOOKUP formulas unless you deliberately want approximate matching. Accidentally omitting the fourth argument can cause Excel to return an unexpected result.

7. Understanding XLOOKUP Match Modes

Match Mode Meaning Example Use
0 Exact match; this is the default Find a product using its exact product code
-1 Exact match or next smaller item Find the commission threshold at or below sales achieved
1 Exact match or next larger item Find the next qualifying threshold above a value
2 Wildcard match using characters such as * and ? Search for a text entry that follows a pattern

Note: Wildcard matching is not the same as approximate numeric matching. It is used to search for text patterns. The search_mode argument is separate from match_mode and controls the search direction or algorithm.

8. Practical Example: Student Grade Calculation

A school can use approximate matching to assign grades based on score thresholds.

Minimum Score Grade
0 F
40 D
50 C
60 B
75 A
90 A+

Suppose the student's score is stored in E2 and the threshold table is in A2:B7.

Formula Using VLOOKUP

=VLOOKUP(E2,A2:B7,2,TRUE)

If E2 contains 82, the result is A because 75 is the largest threshold less than or equal to 82.

Formula Using XLOOKUP

=XLOOKUP(E2,A2:A7,B2:B7,"No Grade",-1)

This formula also returns A for a score of 82. The threshold column must represent the intended grading boundaries, and the lowest threshold should cover the minimum valid score.

9. Practical Example: Exact Product Price Lookup

A business may need to retrieve a product price using a unique product code.

Product Code Product Price
P101 Keyboard 850
P102 Mouse 450
P103 Monitor 7500
P104 Headphones 1200

Assume the product code to search for is in E2 and the table is in A2:C5.

Using XLOOKUP

=XLOOKUP(E2,A2:A5,C2:C5,"Product Not Found",0)

If E2 contains P103, the formula returns 7500. If the code is not found, it returns the message Product Not Found.

Using VLOOKUP

=VLOOKUP(E2,A2:C5,3,FALSE)

This formula searches for the exact product code in the first column and returns the price from the third column of the selected table.

10. Using MATCH for Exact and Approximate Searches

The MATCH function returns the relative position of a value in a range rather than returning a value from another column.

Exact Match with MATCH

=MATCH(E2,A2:A10,0)

The third argument, 0, requests an exact match. If the value in E2 is found in the range A2:A10, Excel returns its relative position within that range.

Approximate Match with MATCH

=MATCH(E2,A2:A10,1)

Match type 1 finds the largest value less than or equal to the lookup value and requires the lookup range to be sorted in ascending order.

=MATCH(E2,A2:A10,-1)

Match type -1 finds the smallest value greater than or equal to the lookup value and requires the lookup range to be sorted in descending order.

Important: MATCH uses different approximate-match rules from XLOOKUP. Always check the function's argument definitions before reusing a formula pattern.

11. Handling Missing Values and Errors

Lookup formulas may fail when the lookup value is missing, the data contains inconsistent formats, or the selected range is incorrect. Use error handling to make reports easier to understand.

Using XLOOKUP's if_not_found Argument

=XLOOKUP(E2,A2:A10,B2:B10,"No Match",0)

The formula returns No Match if the exact value cannot be found.

Using IFERROR with VLOOKUP

=IFERROR(VLOOKUP(E2,A2:C10,3,FALSE),"No Match Found")

IFERROR replaces an error with a clear message. However, it can hide errors other than missing values. If you need to distinguish between different error types, investigate the underlying issue instead of automatically suppressing every error.

Common Causes of Lookup Problems

  • Numbers stored as text in one range and as numbers in another.
  • Leading or trailing spaces in text values.
  • Incorrect lookup or return ranges.
  • Approximate-match data that is not sorted as required.
  • Missing values or duplicate identifiers.
  • Using the wrong column index in VLOOKUP.
  • Using an XLOOKUP match mode that does not fit the business rule.

12. Troubleshooting Lookup Errors

Problem Possible Cause Solution
#N/A No qualifying match was found Verify the lookup value and ranges; use an appropriate not-found message
Incorrect threshold result Unsorted VLOOKUP approximate-match table Sort the first lookup column in ascending order
Unexpected VLOOKUP result TRUE used instead of FALSE Use FALSE for exact matching
#REF! Invalid column index or broken reference Check the table range and VLOOKUP column index
Value appears identical but does not match Extra spaces or different data types Clean text and standardize number formats
Wrong approximate bracket Incorrect threshold boundaries or match mode Confirm the intended range rules and use the correct match mode
Formula does not calculate as expected Formula syntax or cell references are incorrect Check separators, ranges, parentheses and workbook calculation settings

13. Best Practices for Exact and Approximate Lookups

  • Use exact matching for unique identifiers such as employee IDs, invoice numbers and product codes.
  • Use approximate matching only when the business rule is based on ranges or thresholds.
  • Specify the match argument explicitly in VLOOKUP formulas.
  • Sort the first lookup column in ascending order when using VLOOKUP with TRUE.
  • Use XLOOKUP's match mode deliberately: 0 for exact, -1 for next smaller, and 1 for next larger.
  • Make sure the smallest threshold covers the lowest valid input and verify the highest threshold as well.
  • Test values immediately below, at, and immediately above every threshold.
  • Use meaningful not-found messages so users can understand missing results.
  • Keep lookup tables free from duplicate or conflicting thresholds.
  • Use absolute references such as $A$2:$B$10 when copying formulas down a worksheet.
  • Document the business meaning of each threshold, especially in financial and grading models.
  • Validate important calculations independently before using them in business reports.

14. Practice Exercises

Exercise 1: Employee Lookup

Create a table containing employee IDs, names and departments. Use XLOOKUP or VLOOKUP to retrieve the department for a specified employee ID using exact matching.

Exercise 2: Commission Calculation

Create a table of sales thresholds and commission percentages. Calculate the commission rate for sales values of 8,000, 18,000, 42,000 and 85,000 using approximate matching.

Exercise 3: Student Grades

Build a grading table with minimum score thresholds. Write an approximate-match formula and test scores at the boundaries, including 39, 40, 59, 60, 74, 75 and 90.

Exercise 4: Product Price Search

Create a product catalogue and use exact matching to retrieve prices based on product codes. Test the formula with an invalid product code.

Exercise 5: Compare Lookup Methods

Use the same dataset to compare VLOOKUP with FALSE, VLOOKUP with TRUE, XLOOKUP with match mode 0, and XLOOKUP with match mode -1. Record the results and explain why they differ.

15. Mini Project: Sales Commission Lookup Model

Project objective: Build an Excel worksheet that calculates the applicable commission rate and commission amount for each sales employee.

Suggested Data Structure

Employee Sales Amount Commission Rate Commission Amount
Rahul 18000 Formula Formula
Priya 42000 Formula Formula
Amit 85000 Formula Formula

Assume the commission threshold table is stored in H2:I6, with minimum sales in column H and commission rates in column I. Enter the formula below in C2 and copy it down:

=XLOOKUP(B2,$H$2:$H$6,$I$2:$I$6,"No Rate",-1)

Calculate the commission amount in D2 with:

=B2*C2

Format the commission rate as a percentage and the sales and commission amounts as currency or numbers. Test the workbook using values below the minimum threshold, exactly at a threshold, between thresholds, and above the highest threshold. Confirm that the threshold table represents the organization's approved commission policy.

16. Interview Questions and Answers

Q1. What is the difference between exact and approximate matching?

Answer: Exact matching looks for an identical lookup value. Approximate matching selects a qualifying value based on a range or nearest-value rule, such as the largest threshold not exceeding a sales amount.

Q2. How do you perform an exact match using VLOOKUP?

Answer: Use FALSE or 0 as the fourth argument, for example =VLOOKUP(E2,A2:C10,3,FALSE).

Q3. What happens if the fourth argument of VLOOKUP is omitted?

Answer: VLOOKUP defaults to approximate matching. This can produce unexpected results if an exact match was intended.

Q4. Why must a VLOOKUP approximate-match table be sorted?

Answer: Approximate VLOOKUP relies on an ascending lookup column to identify the largest value less than or equal to the lookup value. An unsorted table can return incorrect results.

Q5. Which XLOOKUP match mode finds an exact value or the next smaller item?

Answer: Match mode -1.

Q6. Which XLOOKUP match mode finds an exact value or the next larger item?

Answer: Match mode 1.

Q7. Can XLOOKUP return a custom message if a value is not found?

Answer: Yes. Use the optional if_not_found argument, such as =XLOOKUP(E2,A2:A10,B2:B10,"Not Found",0).

Q8. What is the difference between XLOOKUP and VLOOKUP?

Answer: XLOOKUP separates the lookup range from the return range, can return results from either side of the lookup range, and provides explicit match modes. VLOOKUP searches in the first column of its table array and returns a value from a column to its right.

Q9. What does MATCH return?

Answer: MATCH returns the relative position of the matching item within a lookup range, rather than returning the associated value itself.

Q10. How can lookup errors be reduced?

Answer: Verify the lookup and return ranges, standardize data types, clean text, use the correct match mode, sort threshold data when required, and test boundary values.

17. Quick Revision Checklist

  • Exact match is appropriate for identifiers and values that must match precisely.
  • Approximate matching is useful for grades, commissions, discounts and other threshold-based calculations.
  • VLOOKUP uses FALSE or 0 for exact matching and TRUE or 1 for approximate matching.
  • VLOOKUP approximate matching requires its first table column to be sorted in ascending order.
  • XLOOKUP uses 0 for exact matching, -1 for exact or next smaller, and 1 for exact or next larger.
  • MATCH returns a relative position and uses its third argument to control match behavior.
  • Test threshold boundaries and missing values before relying on a lookup model.
  • Use clear error messages and validate important business calculations.

18. Conclusion

Exact and approximate match lookups are essential techniques for retrieving data and building dependable Excel models. Exact matching is best for unique identifiers and precise searches, while approximate matching is useful when a result depends on thresholds, ranges or qualifying values.

By understanding the behavior of VLOOKUP, XLOOKUP and MATCH, using the correct match arguments, maintaining well-structured lookup tables and testing boundary cases, you can create more accurate and maintainable Excel reports. Practising these techniques with real-world datasets will strengthen your ability to solve data retrieval and business calculation problems in Advanced Excel.

Explore more training: Visit JustAcademy's Advanced Excel Course, register for a course demo, or explore the JustAcademy website.

Previous Next
whatsapp